const {
  override,
  fixBabelImports,
  addLessLoader,
  addWebpackAlias,
  
} = require("customize-cra")
const path = require("path")

function resolve(dir) {
  return path.join(__dirname, dir);
}

module.exports = override(

  fixBabelImports("import", {
    libraryName: "antd",
    libraryDirectory: "es",
    style: true, // 自动打包相关的样式
  }),

   // 使用less-loader对源码中的less的变量进行重新指定
   addLessLoader({
    javascriptEnabled: true,
    modifyVars: { "@primary-color": "#00A57C" },
  }),

  // 配置路径别名
  addWebpackAlias({
    "@": resolve("src"),
  }),
)
